﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Benefit.Models.ServerData
{
    /// <summary>
    /// 合约表
    /// </summary>
    public class T_Instrument
    {
        /// <summary>
        /// 编号
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 合约编号
        /// </summary>
        public string InstrumentID { get; set; }
        /// <summary>
        /// 交易所代码
        /// </summary>
        public string ExchangeID { get; set; }
        /// <summary>
        /// 合约名称
        /// </summary>
        public string InstrumentName { get; set; }
        /// <summary>
        /// 合约在交易所的代码
        /// </summary>
        public string ExchangeInstID { get; set; }

        /// <summary>
        /// 产品代码
        /// </summary>
        public string ProductID { get; set; }

        /// <summary>
        /// 产品类型
        /// </summary>
        public string ProductClass { get; set; }
        /// <summary>
        /// 交割年份
        /// </summary>
        public int DeliveryYear { get; set; }

        /// <summary>
        /// 交割月份
        /// </summary>
        public int DeliveryMonth { get; set; }
        /// <summary>
        /// 市价单最大下单量
        /// </summary>
        public int MaxMarketOrderVolume { get; set; }

        /// <summary>
        /// 市价单最小下单量
        /// </summary>
        public int MinMarketOrderVolume { get; set; }

        /// <summary>
        /// 限价单最大下单量
        /// </summary>
        public int MaxLimitOrderVolume { get; set; }

        /// <summary>
        /// 限价单最小下单量
        /// </summary>
        public int MinLimitOrderVolume { get; set; }
        /// <summary>
        /// 合约数量乘数
        /// </summary>
        public int VolumeMultiple { get; set; }

        /// <summary>
        /// 最小变动价位
        /// </summary>
        public double PriceTick { get; set; }

        /// <summary>
        /// 创建日
        /// </summary>
        public string CreateDate { get; set; }
        /// <summary>
        /// 上市日
        /// </summary>
        public string OpenDate { get; set; }
        /// <summary>
        /// 到期日
        /// </summary>
        public string ExpireDate { get; set; }
        /// <summary>
        /// 开始交割日
        /// </summary>
        public string StartDelivDate { get; set; }
        /// <summary>
        /// 结束交割日
        /// </summary>
        public string EndDelivDate { get; set; }
        /// <summary>
        /// 合约声明周期状态
        /// </summary>
        public string InstlifePhase { get; set; }
        /// <summary>
        /// 当前是否交易
        /// </summary>
        public int IsTrading { get; set; }
        /// <summary>
        /// 持仓类型
        /// </summary>
        public string PositionType { get; set; }
        /// <summary>
        /// 持仓日期类型
        /// </summary>
        public string PositionDateType { get; set; }
        /// <summary>
        /// 多头保证金率
        /// </summary>
        public double LongMarginRatIO { get; set; }
        /// <summary>
        /// 空头保证金率
        /// </summary>
        public double ShortMarginRatIO { get; set; }

        ///// <summary>
        ///// 获取所有合约
        ///// </summary>
        ///// <returns></returns>
        //public List<T_Instrument> GetList()
        //{
        //    List<T_Instrument> instruments = new List<T_Instrument>();
        //    List<object> objs = Common.ADO.DBManager.GetList(new T_Instrument());
        //    foreach (T_Instrument p in objs)
        //    {
        //        instruments.Add(p);
        //    }
        //    return instruments;
        //}
    }
}